home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 1 / csmp-v1-160.txt < prev    next >
Text File  |  1992-12-31  |  46KB  |  1,233 lines

  1. C.S.M.P. Digest             Tue, 04 Aug 92       Volume 1 : Issue 160
  2.  
  3. Today's Topics:
  4.  
  5.     Walking the catalog b-tree...
  6.     Drawing with the mouse
  7.     Converting floats to strings Question
  8.     SOUND: Volume decreases after first command
  9.     Programmers Switch/Handles
  10.     Calling Apple Events from an Init/CDEV?
  11.  
  12.  
  13.  
  14. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  15.  
  16. The digest is a collection of article threads from the internet newsgroup
  17. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  18. regularly and want an archive of the discussions.  If you don't know what a
  19. newsgroup is, you probably don't have access to it.  Ask your systems
  20. administrator(s) for details.  (This means you can't post questions to the
  21. digest.)
  22.  
  23. Each issue of the digest contains one or more sets of articles (called
  24. threads), with each set corresponding to a 'discussion' of a particular
  25. subject.  The articles are not edited; all articles included in this digest
  26. are in their original posted form (as received by our news server at
  27. cs.uoregon.edu).  Article threads are not added to the digest until the last
  28. article added to the thread is at least one month old (this is to ensure that
  29. the thread is dead before adding it to the digest).  Article threads that
  30. consist of only one message are generally not included in the digest.
  31.  
  32. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  33. [128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
  34. file /pub/mac/csmp-digest/README before downloading any files.  The most
  35. recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
  36. directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
  37. archive has a mail server; send a message with the text '$MACarch help' (no
  38. quotes) to LISTSERV@ricevm1.rice.edu for more information.
  39.  
  40. The digest is also available via email.  Just send a note saying that you
  41. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  42. automatically receive each new issue as it is created.  Sorry, back issues
  43. are not available through the mailing list.
  44.  
  45. Send administrative mail to mkelly@cs.uoregon.edu.
  46.  
  47.  
  48. -------------------------------------------------------
  49.  
  50. From: dirty@engin.umich.edu (Cameron Esfahani)
  51. Subject: Walking the catalog b-tree...
  52. Date: 13 Jun 92 03:21:35 GMT
  53. Organization: caen
  54.  
  55. Pity me...I have figured that the only way that I can find a file if
  56. I just have it's file reference number and volume reference number
  57. is to open the catalog tree file on the volume and search through it.
  58. Now, IM-IV is very, very bad in explaining simple things such as the
  59. size of the nodes in the catalog b-tree.  Does anyone out there have
  60. any information, code, suggestions on how to do this?  I have 
  61. written a simple app which opens the catalog tree file up, but I don't
  62. see any recognizable information until about 500 bytes into the buffer...
  63. Does anyone know anything about this?
  64.  
  65.  
  66. Thanks,
  67.  
  68. Cameron Esfahani
  69. dirty@engin.umich.edu
  70.  
  71. +++++++++++++++++++++++++++
  72.  
  73. From: keith@taligent.com (Keith Rollin)
  74. Date: 15 Jun 92 20:10:08 GMT
  75. Organization: Taligent
  76.  
  77. In article <mN--2z=@engin.umich.edu>, dirty@engin.umich.edu (Cameron Esfahani)
  78. writes:
  79. > Pity me...I have figured that the only way that I can find a file if
  80. > I just have it's file reference number and volume reference number
  81. > is to open the catalog tree file on the volume and search through it.
  82. > Now, IM-IV is very, very bad in explaining simple things such as the
  83. > size of the nodes in the catalog b-tree.  Does anyone out there have
  84. > any information, code, suggestions on how to do this?  I have 
  85. > written a simple app which opens the catalog tree file up, but I don't
  86. > see any recognizable information until about 500 bytes into the buffer...
  87. > Does anyone know anything about this?
  88.  
  89. You shouldn't have to open up the catalog file yourself. Either use PBCatSearch
  90. (under 7.0) or use the routine shown in Mac Technote #68.
  91.  
  92. So why is it that you only have the file's ID number and vRefNum? Why don't you
  93. have it's dirID?
  94.  
  95. - --
  96. Keith Rollin
  97. Phantom Programmer
  98. Taligent, Inc.
  99.  
  100.  
  101. +++++++++++++++++++++++++++
  102.  
  103. From: Cameron Esfahani <dirty@engin.umich.edu>
  104. Date: Mon, 15 Jun 92 23:30:10 EDT
  105. Organization: caen
  106.  
  107. >You shouldn't have to open up the catalog file yourself. Either use
  108. PBCatSearch
  109. >(under 7.0) or use the routine shown in Mac Technote #68.
  110. >
  111. >So why is it that you only have the file's ID number and vRefNum? Why
  112. don't you
  113. >have it's dirID?
  114. >
  115. >--
  116. >Keith Rollin
  117. >Phantom Programmer
  118. >Taligent, Inc.
  119.  
  120. I have figured out how to find out what is currently selected in the 
  121. Finder.  However, at the place I do my "thing", I only have the file
  122. reference number, volume reference number, name, type and creator
  123. available to me.  I have found a solution to my problem however, I just
  124. use PBCatSearch to search on name, type, and creator on the volume.
  125. I then ues PBGetCatInfo to compare all the file reference numbers.
  126. Cameron "Make Mine a 99" Esfahani
  127. dirty@engin.umich.edu
  128.  
  129. +++++++++++++++++++++++++++
  130.  
  131. From: Cameron Esfahani <dirty@engin.umich.edu>
  132. Date: Mon, 15 Jun 92 23:31:15 EDT
  133. Organization: caen
  134.  
  135. >You shouldn't have to open up the catalog file yourself. Either use
  136. PBCatSearch
  137. >(under 7.0) or use the routine shown in Mac Technote #68.
  138. >
  139. >So why is it that you only have the file's ID number and vRefNum? Why
  140. don't you
  141. >have it's dirID?
  142. >
  143. >--
  144. >Keith Rollin
  145. >Phantom Programmer
  146. >Taligent, Inc.
  147.  
  148. I have figured out how to find out what is currently selected in the 
  149. Finder.  However, at the place I do my "thing", I only have the file
  150. reference number, volume reference number, name, type and creator
  151. available to me.  I have found a solution to my problem however, I just
  152. use PBCatSearch to search on name, type, and creator on the volume.
  153. I then ues PBGetCatInfo to compare all the file reference numbers.
  154. Cameron "Make Mine a 99" Esfahani
  155. dirty@engin.umich.edu
  156.  
  157. +++++++++++++++++++++++++++
  158.  
  159. From: David R. Falkenburg <falken@engin.umich.edu>
  160. Date: Tue, 16 Jun 92 11:19:10 EDT
  161. Organization: University of Michigan College of Engineering
  162.  
  163. >In article <mN--2z=@engin.umich.edu>, dirty@engin.umich.edu (Cameron
  164. Esfahani)
  165. >writes:
  166. >> 
  167. >> Pity me...I have figured that the only way that I can find a file if
  168. >> I just have it's file reference number and volume reference number
  169. >> is to open the catalog tree file on the volume and search through it.
  170. >> Now, IM-IV is very, very bad in explaining simple things such as the
  171. >> size of the nodes in the catalog b-tree.  Does anyone out there have
  172. >> any information, code, suggestions on how to do this?  I have 
  173. >> written a simple app which opens the catalog tree file up, but I don't
  174. >> see any recognizable information until about 500 bytes into the
  175. buffer...
  176. >> Does anyone know anything about this?
  177.  
  178. You DON'T want to walk th B-Trees yourself.  Trust me.
  179.  
  180. If you've got a "file number", why not try _GetFCBInfo...  See IM-IV-179.
  181.  
  182. This better be a good hack
  183.  
  184. - -dave falkenburg
  185.  university of michigan, college of engineering
  186.  
  187. - --dave falkenburg
  188. - --university of michigan college of engineering
  189. - --falken@engin.umich.edu
  190.  
  191. +++++++++++++++++++++++++++
  192.  
  193. From: ewylie@ocf.berkeley.edu (Elizabeth Wylie)
  194. Date: 17 Jun 1992 00:51:27 GMT
  195. Organization: U. C. Berkeley Open Computing Facility
  196.  
  197. The problem with GetFCBInfo is that it will only find the file if it is open. A
  198. n undocumented feature of PBGetCatInfo allows you to pass a file number in the
  199. ioDirID field.  Since this is undocumented, it could fail in the future, but
  200. because of the way the disk catalog is set up, I'd be surprised if it did.
  201.  
  202. If you are talking about file reference unmbres, then GetFCBInfo is the way to
  203. go.
  204.  
  205. (Why do you only have the file number?!)
  206.  
  207. - -E. Wylie
  208.  
  209.  
  210. +++++++++++++++++++++++++++
  211.  
  212. From: buckeye@spf.trw.com (John Wallace)
  213. Date: 25 Jun 92 18:18:19 GMT
  214. Organization: TRW Data Systems Center, Redondo Beach, CA
  215.  
  216. In article <11m2afINNr0k@agate.berkeley.edu> ewylie@ocf.berkeley.edu (Elizabeth Wylie) writes:
  217. >An undocumented feature of PBGetCatInfo allows you to pass a file number in the
  218. >ioDirID field.  Since this is undocumented, it could fail in the future, but
  219. >because of the way the disk catalog is set up, I'd be surprised if it did.
  220. >
  221. >-E. Wylie
  222. >
  223.  
  224. InsideMac-IV claims that if you pass in a dirId in ioDirId and a -1
  225. in ioDirIndex that it will return information about a directory.  I've
  226. tried the same thing with passing a fileId in the ioDirId field, and
  227. it failed.  My understanding is that it isn't possible for the B-tree
  228. to provide access using fileIds because of the way it stores the data.
  229. Am I (hopefully) wrong?
  230.  
  231. Thanks!
  232. John
  233.  
  234. +++++++++++++++++++++++++++
  235.  
  236. From: heksterb@cs.utwente.nl (Ben Hekster)
  237. Organization: University of Twente, Dept. of Computer Science
  238. Date: Fri, 26 Jun 1992 03:33:15 GMT
  239.  
  240. In article <11m2afINNr0k@agate.berkeley.edu> ewylie@ocf.berkeley.edu (Elizabeth Wylie) writes:
  241. >An undocumented feature of PBGetCatInfo allows you to pass a file number in the
  242. >ioDirID field.  Since this is undocumented, it could fail in the future, but
  243. >because of the way the disk catalog is set up, I'd be surprised if it did.
  244. >
  245. >-E. Wylie
  246.  
  247. In article <2A4A0DEB.46B6@deneva.sdd.trw.com> buckeye@spf.trw.com (John Wallace) writes:
  248. >
  249. >InsideMac-IV claims that if you pass in a dirId in ioDirId and a -1
  250. >in ioDirIndex that it will return information about a directory.  I've
  251. >tried the same thing with passing a fileId in the ioDirId field, and
  252. >it failed.  My understanding is that it isn't possible for the B-tree
  253. >to provide access using fileIds because of the way it stores the data.
  254. >Am I (hopefully) wrong?
  255.  
  256. I hope you are (and I am, too).  I tried it and it didn't work for me,
  257. either.  It's unfortunate, because it would have been much nicer to use
  258. PBGetCatInfo for files and directories alike, instead of PBResolveFileID
  259. for files.
  260.  
  261.     However, PBGetCatInfo *will* return both file and directory
  262. IDs in ioDirID.
  263.  
  264. Ah, well.
  265.  
  266. - -- 
  267. Ben `Hackster' Hekster        | "He bides his time and thinks,
  268. heksterb@cs.utwente.nl        |  'There must be more to life than this!'"
  269.  
  270. +++++++++++++++++++++++++++
  271.  
  272. From: absurd@applelink.apple.com (Tim Dierks, software saboteur)
  273. Date: 1 Jul 92 17:49:45 GMT
  274. Organization: MacDTS Misfits
  275.  
  276. In article <2A4A0DEB.46B6@deneva.sdd.trw.com>, buckeye@spf.trw.com (John Wallace) writes:
  277. > In article <11m2afINNr0k@agate.berkeley.edu> ewylie@ocf.berkeley.edu (Elizabeth Wylie) writes:
  278. > >An undocumented feature of PBGetCatInfo allows you to pass a file number in the
  279. > >ioDirID field.  Since this is undocumented, it could fail in the future, but
  280. > >because of the way the disk catalog is set up, I'd be surprised if it did.
  281. > >
  282. > >-E. Wylie
  283. > >
  284. > InsideMac-IV claims that if you pass in a dirId in ioDirId and a -1
  285. > in ioDirIndex that it will return information about a directory.  I've
  286. > tried the same thing with passing a fileId in the ioDirId field, and
  287. > it failed.  My understanding is that it isn't possible for the B-tree
  288. > to provide access using fileIds because of the way it stores the data.
  289. > Am I (hopefully) wrong?
  290. > Thanks!
  291. > John
  292.  
  293. Just call PBResolveFileIDRef(), as documented on page 25-46 of IM VI.  It
  294. will take a file ID and locate the appropriate file.
  295.  
  296. Tim Dierks
  297. MacDTS, but I speak for the trees
  298.  
  299.  
  300. +++++++++++++++++++++++++++
  301.  
  302. From: keith@taligent.com (Keith Rollin)
  303. Date: 1 Jul 92 19:57:38 GMT
  304. Organization: Taligent
  305.  
  306. In article <27663@goofy.Apple.COM>, absurd@applelink.apple.com (Tim Dierks,
  307. software saboteur) writes:
  308. > In article <2A4A0DEB.46B6@deneva.sdd.trw.com>, buckeye@spf.trw.com (John
  309. Wallace) writes:
  310. > > 
  311. > > In article <11m2afINNr0k@agate.berkeley.edu> ewylie@ocf.berkeley.edu
  312. (Elizabeth Wylie) writes:
  313. > > >An undocumented feature of PBGetCatInfo allows you to pass a file number in
  314. the
  315. > > >ioDirID field.  Since this is undocumented, it could fail in the future,
  316. but
  317. > > >because of the way the disk catalog is set up, I'd be surprised if it did.
  318. > > >
  319. > > >-E. Wylie
  320. > > >
  321. > > 
  322. > > InsideMac-IV claims that if you pass in a dirId in ioDirId and a -1
  323. > > in ioDirIndex that it will return information about a directory.  I've
  324. > > tried the same thing with passing a fileId in the ioDirId field, and
  325. > > it failed.  My understanding is that it isn't possible for the B-tree
  326. > > to provide access using fileIds because of the way it stores the data.
  327. > > Am I (hopefully) wrong?
  328. > > 
  329. > > Thanks!
  330. > > John
  331. > Just call PBResolveFileIDRef(), as documented on page 25-46 of IM VI.  It
  332. > will take a file ID and locate the appropriate file.
  333. >
  334.  
  335. My System 7.0 File Manager knowledge is a little rusty, but I think
  336. PBResolveFileIDRef works only if a file thread record has been created by first
  337. calling PBCreateFileIDRef (see the last line of the PBResolveFileIDRef
  338. description). I've never actually made these calls, so if you have experience
  339. bearing out your comment, I'll defer to you.
  340.  
  341. - --
  342. Keith Rollin
  343. Phantom Programmer
  344. Taligent, Inc.
  345.  
  346.  
  347. ---------------------------
  348.  
  349. From: poon@parc.xerox.com (Alex Poon)
  350. Subject: Drawing with the mouse
  351. Organization: Xerox PARC
  352. Date: 22 Jun 92 20:56:08 GMT
  353.  
  354. I have an external window in hypercard in which I want to allow users
  355. to draw with a mouse.  The code segment is as follows:
  356.  
  357. ...
  358. switch (event.what) {
  359.  
  360.   case mouseDown:
  361.      GetMouse(&curpoint);
  362.      MoveTo(curpoint.h,curpoint.v);
  363.      while (StillDown()) {
  364.         GetMouse(&curpoint);
  365.         LineTo(curpoint.h,curpoint.v);
  366.         }
  367.      break;
  368.  
  369. ...
  370. (where GetMouse(), StillDown(), MoveTo(), and LineTo() are toolbox
  371.  routines).
  372.  
  373. The problem is that the drawing turns out not to be smooth -- if I try
  374. drawing large circles really fast, I get triangles, squares, and other
  375. various polygons.  Drawing with the hypercard pencil tool is smoother,
  376. but I do not want to use the built-in pencil tool because I need to
  377. do some processing while the user draws in real-time.
  378.  
  379. Does anyone know of a solution?  In general, what is the best way to
  380. draw with the mouse?
  381.  
  382. Alex Poon
  383. poon@parc.xerox.com
  384.  
  385.  
  386.  
  387. +++++++++++++++++++++++++++
  388.  
  389. From: c9107786@frey.newcastle.edu.au (Dave Leonard)
  390. Date: 23 Jun 92 10:05:32 GMT
  391. Organization: Department of Mathematics, Uni of Newcastle, Oz.
  392.  
  393. poon@parc.xerox.com (Alex Poon) writes:
  394.  
  395. >I have an external window in hypercard in which I want to allow users
  396. >to draw with a mouse.  The code segment is as follows:
  397.  
  398. >The problem is that the drawing turns out not to be smooth -- if I try
  399. >drawing large circles really fast, I get triangles, squares, and other
  400. >various polygons.  Drawing with the hypercard pencil tool is smoother,
  401. >but I do not want to use the built-in pencil tool because I need to
  402. >do some processing while the user draws in real-time.
  403.  
  404. the problem appears to be the time for each cycle of your while loop
  405.  
  406. well it seems pretty compact, maybe your compiler doesnt optimize too well
  407. and your code spends a bit of time in glue routines?
  408.  
  409. Maybe you could hand-assemble it using inline assembly: asm { }
  410.  
  411. Not being an absolute wizz at this, i couldnt tell you what to put between
  412. the { and } but your code looked pretty simple and should be Very easy to
  413. implement this way... just the while loop
  414.  
  415. anybody out there want to post the asm {} bit?
  416.  
  417. dave
  418.  
  419. - -- 
  420. Dave Leonard, Uni of Newcastle           c9107786@frey.newcastle.edu.au
  421.     "l;ksd8721" - cat on a keyboard
  422.  
  423. +++++++++++++++++++++++++++
  424.  
  425. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  426. Organization: Royal Institute of Technology, Stockholm, Sweden
  427. Date: Mon, 29 Jun 1992 10:44:23 GMT
  428.  
  429. > c9107786@frey.newcastle.edu.au (Dave Leonard) writes:
  430.  
  431.    >I have an external window in hypercard in which I want to allow users
  432.    >to draw with a mouse.  The code segment is as follows:
  433.  
  434.     while ( StillDown ( ) ) {
  435.  
  436.         GetMouse ( & pt ) ;
  437.         LineTo ( pt . h , pt . v ) ;
  438.     }
  439.  
  440.    >The problem is that the drawing turns out not to be smooth -- if I try
  441.    >drawing large circles really fast, I get triangles, squares, and other
  442.  
  443.    the problem appears to be the time for each cycle of your while loop
  444.  
  445.    well it seems pretty compact, maybe your compiler doesnt optimize too well
  446.    and your code spends a bit of time in glue routines?
  447.  
  448.    Maybe you could hand-assemble it using inline assembly: asm { }
  449.  
  450.  
  451. This is a common misconception. Trust me, the 10 or 20 instructions
  452. emitted by the compiler for the loop mechanics is NOTHING compared
  453. to the time that's spent inside the toolbox for the traps. If the
  454. loop looks as shown above, there isn't much more you can do unless
  455. you draw directly to screen (check the UMPG for such code, and a
  456. decent graphics book for how to draw fast lines) and even that won't
  457. give you toomuch of a speedup.
  458.  
  459. However, the loop as it stands should be fast enough, I strongly
  460. believe something else is going on as well as the drawing. If you
  461. still can't make it work, you can't; buy a faster machine.
  462.  
  463. - -- 
  464.          Jon W{tte, Svartmangatan 18, S-111 29 Stockholm, Sweden
  465.  
  466.  "Difficult, obscure, incoherent and nonstandard does not imply more power."
  467.                - Andrew Kass in comp.sys.mac.hardware
  468.  
  469. +++++++++++++++++++++++++++
  470.  
  471. From: rae@alias.com (Reid Ellis)
  472. Organization: Alias Research, Inc., Toronto ON Canada
  473. Date: Tue, 30 Jun 1992 03:48:29 GMT
  474.  
  475. Dave Leonard <c9107786@frey.newcastle.edu.au> writes:
  476. |I have an external window in hypercard in which I want to allow users
  477. |to draw with a mouse.  The code segment is as follows:
  478. |
  479. |    while (StillDown()) {
  480. |        GetMouse(& pt);
  481. |        LineTo(pt . h , pt . v);
  482. |    }
  483. |
  484. |The problem is that the drawing turns out not to be smooth -- if I try
  485. |drawing large circles really fast, I get triangles, squares, ...
  486.  
  487. Someone else <???> writes:
  488. |   Maybe you could hand-assemble it using inline assembly: asm { }
  489.  
  490. Jon W{tte <d88-jwa@dront.nada.kth.se> writes:
  491. |This is a common misconception. Trust me, the 10 or 20 instructions
  492. |emitted by the compiler for the loop mechanics is NOTHING compared
  493. |to the time that's spent inside the toolbox for the traps.
  494.  
  495. Would the code benefit from GetTrapAddress() to avoid the toolbox trap
  496. mechanism?  Or does this have the unfortunate side effect of possibly
  497. deaccellerating and Quickdraw accellerators running?
  498.  
  499. Reid
  500. - --
  501. Reid Ellis                                            
  502. rae@utcs.utoronto.ca        ||           rae@Alias.com
  503. CDA0610@applelink.apple.com ||  +1 416 362 9181 [work]
  504.  
  505. +++++++++++++++++++++++++++
  506.  
  507. From: cjacobs@cs.washington.edu (Charles Jacobs)
  508. Organization: Computer Science & Engineering, U. of Washington, Seattle
  509. Date: Tue, 30 Jun 92 07:53:14 GMT
  510.  
  511. Dave Leonard <c9107786@frey.newcastle.edu.au> writes:
  512. |I have an external window in hypercard in which I want to allow users
  513. |to draw with a mouse.  The code segment is as follows:
  514. |
  515. |    while (StillDown()) {
  516. |        GetMouse(& pt);
  517. |        LineTo(pt . h , pt . v);
  518. |    }
  519. |
  520. |The problem is that the drawing turns out not to be smooth -- if I try
  521. |drawing large circles really fast, I get triangles, squares, ...
  522.  
  523.   Yeah, I did the same thing a couple of weeks ago, and what helped me a lot
  524. was to remember the old location and only draw if it's necessary -- made a
  525. dramatic improvement, without resorting to yuckiness like assembly or
  526. other stuff I don't understand (heh)..
  527. try this (forgive me for the syntactic & stylistic errors that are bound
  528. to follow... I'm tired):
  529.     GetMouse (& oldPt);
  530.     while (StillDown()) {
  531.         GetMouse(& pt);
  532.         if (oldPt != pt) {
  533.             LineTo (pt.h, pt.v);
  534.             oldPt = pt
  535.         }
  536.     }
  537.  
  538. I think that's right... anyway, you get the idea...
  539. chuck
  540.  
  541.  
  542.  
  543. +++++++++++++++++++++++++++
  544.  
  545. From: scott@mcl.ucsb.edu (Scott Bronson)
  546. Date: 1 Jul 92 17:36:19 GMT
  547.  
  548. In <D88-JWA.92Jun29114423@dront.nada.kth.se> d88-jwa@dront.nada.kth.se (Jon W{tte) writes:
  549.  
  550. >> c9107786@frey.newcastle.edu.au (Dave Leonard) writes:
  551.  
  552. >   >I have an external window in hypercard in which I want to allow users
  553. >   >to draw with a mouse.  The code segment is as follows:
  554.  
  555. >    while ( StillDown ( ) ) {
  556.  
  557. >        GetMouse ( & pt ) ;
  558. >        LineTo ( pt . h , pt . v ) ;
  559. >    }
  560.  
  561. >   >The problem is that the drawing turns out not to be smooth -- if I try
  562. >   >drawing large circles really fast, I get triangles, squares, and other
  563.  
  564.  
  565. >However, the loop as it stands should be fast enough, I strongly
  566. >believe something else is going on as well as the drawing. If you
  567. >still can't make it work, you can't; buy a faster machine.
  568.  
  569. There is a more complex technique you can try.  I think Fractal Design's
  570. Painter uses it.  Install a VBL task that queues mouse locations about
  571. every other tick into a large buffer.  Then you are assured that the
  572. mouse will be polled 30 times a second, resulting in a (hopefully)
  573. smooth line.  You can play with the number of times a second the mouse
  574. is polled; the larger the buffer, the more points can be stored before
  575. the computer catches up, and the smoother the curve.
  576.  
  577. Then, your main program can simply go running through this buffer in
  578. a tight loop:
  579.  
  580. #include<sys/stdsyntaxdisclaimer.h>
  581.  
  582. Point oldpoint, mousepoint, *mp;
  583.  
  584. while( StillDown() ) {
  585.     mousepoint = *(mp++);
  586.     if( ((long*)&mousepoint) != ((long*)&oldpoint) ) {
  587.     oldpoint = mousepoint;
  588.     LineTo( mousepoint );
  589.     }
  590. }
  591.  
  592. A circular buffer would allow you to track the mouse for as long as the
  593. user holds it down.  Just make sure that your loop doesn't pass your VBL,
  594. (concievable on moderately fast machines especially with accelerated QD)
  595. or you'll get garbage instead of good mouse locations.
  596.  
  597.     - Scott
  598.  
  599. +++++++++++++++++++++++++++
  600.  
  601. From: mxmora@unix.SRI.COM (Matt Mora)
  602. Date: 1 Jul 92 16:00:44 GMT
  603. Organization: SRI International, Menlo Park, California
  604.  
  605. In article <1992Jun30.034829.22055@alias.com> rae@alias.com (Reid Ellis) writes:
  606. >Dave Leonard <c9107786@frey.newcastle.edu.au> writes:
  607.  
  608. >|The problem is that the drawing turns out not to be smooth -- if I try
  609. >|drawing large circles really fast, I get triangles, squares, ...
  610.  
  611. >Would the code benefit from GetTrapAddress() to avoid the toolbox trap
  612. >mechanism?  Or does this have the unfortunate side effect of possibly
  613. >deaccellerating and Quickdraw accellerators running?
  614.  
  615. You could try setting the mouse tracking speed to a lower value.
  616. This should give a more accurate tracking of the mouse. The vbl task
  617. won't give you the huge delta changes that give you the triangles and
  618. squares. Its probably not a nice thing to do to a user but if you set it 
  619. back to what it was before the tracking code maybe the user won't notice.
  620.  
  621. Matt
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633. - -- 
  634. ___________________________________________________________
  635. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  636. SRI International           |  my unix  mxmora@unix.sri.com
  637. ___________________________________________________________
  638.  
  639. ---------------------------
  640.  
  641. From: pgc@po.CWRU.Edu (Peter G. Cramer)
  642. Subject: Converting floats to strings Question
  643. Date: 23 Jun 92 21:02:42 GMT
  644. Organization: Case Western Reserve University, Cleveland, OH (USA)
  645.  
  646.  
  647. Help!   I need a C function that converts a float to a string.
  648.  
  649. ANSI C provides a function called "gcvt" for this purpose 
  650. (it's part of stdlib.h), but it wasn't supplied with Think C.  
  651. If anyone can direct me to source code for this, I would 
  652. be eternally grateful!
  653.  
  654. All the Best
  655. - -- 
  656. Peter G. Cramer, Physics Department, CWRU
  657. University Circle   Cleveland, Ohio 44106
  658. (216) 368-3656            pgc@po.cwru.edu  
  659.  
  660. +++++++++++++++++++++++++++
  661.  
  662. From: suitti@ima.isc.com (Stephen Uitti)
  663. Organization: Interactive Systems, Cambridge, MA 02138-5302
  664. Date: Wed, 24 Jun 1992 00:06:30 GMT
  665.  
  666. In article <1992Jun23.210242.27037@usenet.ins.cwru.edu> pgc@po.CWRU.Edu (Peter G. Cramer) writes:
  667. >
  668. >Help!   I need a C function that converts a float to a string.
  669. >
  670. >ANSI C provides a function called "gcvt" for this purpose 
  671. >(it's part of stdlib.h), but it wasn't supplied with Think C.  
  672. >If anyone can direct me to source code for this, I would 
  673. >be eternally grateful!
  674.  
  675. How about sprintf()?  You can use it from ANSI-small too.
  676. It works for me.
  677.  
  678. Stephen.
  679. suitti@ima.isc.com
  680.  
  681. +++++++++++++++++++++++++++
  682.  
  683. From: dobrohoczkim@cc4.crl.aecl.ca
  684. Date: 24 Jun 92 12:49:59 GMT
  685. Organization: AECL RESEARCH
  686.  
  687. I also need to convert a float to a string and vice versa. On page 69 of
  688. Inside Macintoch IV it says three new routine have been added to the
  689. Binary-Decimal Convertion Package to do the string to SANE binary data
  690. format conversion and SANE binary data to string conversion. It also
  691. states these functions are documented in the "Apple Numerics Manual". My
  692. problem is that I can not get a hold of this manual. Could some kind soul
  693. tell me how these work or point me to some FTP'able item that would.
  694.  
  695. Thanks,
  696.  
  697. dobrohoczkim@crl.aecl.ca
  698. Michael Dobrohoczki
  699. Chalk River Laboratories
  700. Atomic Energy Canada Ltd.
  701.  
  702. +++++++++++++++++++++++++++
  703.  
  704. From: dowdy@apple.com (Tom Dowdy)
  705. Date: 1 Jul 92 19:11:20 GMT
  706. Organization: Apple Computer, Inc.
  707.  
  708. In article <1992Jun24.000630.16121@ima.isc.com>, suitti@ima.isc.com
  709. (Stephen Uitti) wrote:
  710. > In article <1992Jun23.210242.27037@usenet.ins.cwru.edu> pgc@po.CWRU.Edu (Peter G. Cramer) writes:
  711. > >Help!   I need a C function that converts a float to a string.
  712. > How about sprintf()?  You can use it from ANSI-small too.
  713. > It works for me.
  714.  
  715. How about using the International Utilities instead?  That way your
  716. application will work in places other than the US.
  717.  
  718.  Tom Dowdy                 Internet:  dowdy@apple.COM
  719.  Apple Computer MS:81KS    UUCP:      {sun,voder,amdahl,decwrl}!apple!dowdy
  720.  20525 Mariani Ave         AppleLink: DOWDY1
  721.  Cupertino, CA 95014       
  722.  "The 'Ooh-Ah' Bird is so called because it lays square eggs."
  723.  
  724. ---------------------------
  725.  
  726. From: rjacks@austlcm.sps.mot.com (rodney jacks)
  727. Subject: SOUND: Volume decreases after first command
  728. Organization: Motorola Inc, Austin, Texas
  729. Date: Thu, 25 Jun 1992 14:49:16 GMT
  730.  
  731. Help,
  732.  
  733. I'm having a couple of problems with the Sound Manager that I just
  734. can't figure out.  I'm attempting to play a soundtrack by issuing
  735. a series of sound commands to the sound manager.  Before starting
  736. the soundtrack, my application sets the sound volume to a particular 
  737. volume (that was saved in a preference file) using SetSoundVol.  
  738. When I issue the commands, the soundtrack starts to play and after 
  739. playing the first command/sound at the new volume level, the volume 
  740. switches back to the original volume level. 
  741.  
  742. If I change the volume setting while the soundtrack is already playing
  743. using the Set Volume menu I have provided in my app, everything
  744. works ok (ie. the soundtrack plays at the new volume level).
  745.  
  746. Other than the volume level the soundtrack plays just fine.
  747.  
  748. The other problem I have is that when the soundtrack is playing
  749. and I play some other sound effect in a different channel using 
  750. SoundPlay both the sound effect and the soundtrack seem to 
  751. decrease in volume until the sound effect is finished.
  752.  
  753. I'm basically using the DTS sample code from SoundApp.  I have 
  754. added procedures for starting and stopping the soundtrack, and setting
  755. the volume level.  I use a VBL routine to keep the soundtrack playing.
  756.                                           
  757. I'm running on System 7.0.1 with Tuna Helper if that is important.
  758.  
  759. Thanks for your help,
  760. - -Rodney
  761.  
  762. ***********************************************************************
  763. **  Rodney Jacks                                                     **
  764. **  Motorola Inc, Austin, Texas                                      **
  765. **  E-mail:  rjacks@austlcm.sps.mot.com                              **
  766. **  Picard asks Worf what he thought of commanding the _Enterprise_  **
  767. **  "Comfortable chair."     ST.TNG _The Emissary_                   ** 
  768. ***********************************************************************
  769.  
  770.  
  771.  
  772. +++++++++++++++++++++++++++
  773.  
  774. From: potts@itl.itd.umich.edu (Paul Potts)
  775. Organization: Instructional Technology Laboratory, University of Michigan
  776. Date: Thu, 25 Jun 92 18:44:32 GMT
  777.  
  778. In article <1992Jun25.144916.7561@oakhill.sps.mot.com> rjacks@austlcm.sps.mot.com (rodney jacks) writes:
  779. >Help,
  780. >
  781. <first problem left out to save space>...
  782. >
  783. >The other problem I have is that when the soundtrack is playing
  784. >and I play some other sound effect in a different channel using 
  785. >SoundPlay both the sound effect and the soundtrack seem to 
  786. >decrease in volume until the sound effect is finished.
  787. >
  788. >I'm basically using the DTS sample code from SoundApp.  I have 
  789. >added procedures for starting and stopping the soundtrack, and setting
  790. >the volume level.  I use a VBL routine to keep the soundtrack playing.
  791. >                                          
  792. >I'm running on System 7.0.1 with Tuna Helper if that is important.
  793.  
  794. I'm uncertain about the first problem, but the second problem seems clear:
  795. on the Mac, the volume available for playing sampled sounds gets divided up
  796. between the various sampled sounds playing in different channels. If I play
  797. a sample in channel one and it sounds X loud, if I open up another channel
  798. and play another sample at the same time, the first sample will only sound
  799. roughly X/2 loud.
  800.  
  801. I don't have a really good suggestion to get around this, other than that
  802. you try adjusting to a different volume level when playing sounds
  803. simultaneously. Remember, you've got both the sound chip amplitude (with
  804. setAmpCmd) and the speaker volume to work with, so it is possible to get
  805. fairly fine control over the sound volume levels. 
  806.  
  807. - -- 
  808. The essence of OOP: "With all this horse manure, I know there's got to be
  809.                      a pony in here somewhere!"
  810. Paul R. Potts, Software Designer --- potts@itl.itd.umich.edu <--- me!
  811.  
  812. +++++++++++++++++++++++++++
  813.  
  814. From: REEKES@applelink.apple.com (Jim Reekes)
  815. Date: 1 Jul 92 19:11:58 GMT
  816. Organization: Apple Computer, Inc.
  817.  
  818. In article <1992Jun25.184432.23162@terminator.cc.umich.edu>, potts@itl.itd.umich.edu (Paul Potts) writes:
  819. > In article <1992Jun25.144916.7561@oakhill.sps.mot.com> rjacks@austlcm.sps.mot.com (rodney jacks) writes:
  820. > >Help,
  821. > >
  822. > <first problem left out to save space>...
  823. > >
  824. > >The other problem I have is that when the soundtrack is playing
  825. > >and I play some other sound effect in a different channel using 
  826. > >SoundPlay both the sound effect and the soundtrack seem to 
  827. > >decrease in volume until the sound effect is finished.
  828. > >
  829. > >I'm basically using the DTS sample code from SoundApp.  I have 
  830. > >added procedures for starting and stopping the soundtrack, and setting
  831. > >the volume level.  I use a VBL routine to keep the soundtrack playing.
  832. > >                                          
  833. > >I'm running on System 7.0.1 with Tuna Helper if that is important.
  834.  
  835. This is a design limitation of the Sound Manager.  I'm well aware of the
  836. problem, and we've got a solution in the workings.  Mean while, there's not
  837. much you can to about this.  The only suggestion I can think of it try
  838. playing all of your channels at the same time and you'll not have the volumes
  839. cutting in and out.  When you want one of the channels to stop playing,
  840. change it to a really slow rate (using the rateCmd or freqCmd) that's
  841. below the audible range.  It's a hack and it's a gross idea, but that's
  842. the only suggestion I have.  Just remember that mixing channels costs
  843. CPU time.
  844.  
  845. - -----------------------------------------------------------------------
  846. Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
  847.                              |          Sound Manager Expert
  848. Apple Computer, Inc.         | RAll opinions expressed are mine, and do
  849. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  850. Cupertino, CA 95014          |       employer, Apple Computer Inc.S
  851.  
  852.  
  853.  
  854. ---------------------------
  855.  
  856. From: bberqu@sagpd1 ()
  857. Subject: Programmers Switch/Handles
  858. Date: Mon, 29 Jun 1992 20:28:48 GMT
  859.  
  860.  
  861. I'm new to the mac so bear with me:
  862.  
  863. This is probably a really stupid question, but I can't seem to find it in 
  864. the manual, how do you reset and interrupt the mac on an LC II, I was
  865. reading in my Macsbug manual that the functionality for the programmers 
  866. switch is built into the keyboard (what is the key combination or whatever)?
  867.  
  868. This one's for programmers, when creating a window can I use a Handle for
  869. the wStorage parameter in the call to GetNewWindow, if I use a pointer 
  870. everything works fine, but if I create it with a Handle, this causes me
  871. problems later on in the program for instance in another subroutine after
  872. the window is created I make a call to sprintf to format some data (this
  873. causes the mac to lockup), I'm not doing anything (that I know of) to
  874. the memory obtained by the handle when I make the call to sprintf,
  875. this works just fine by using pointers instead of handles.  Is it OK
  876. to use relocatable blocks for window records?
  877.  
  878. This is how I call GetNewWindow with a handle:
  879.  
  880.        wptr = GetNewWindow ( WINDOWID, *handle, .....
  881.  
  882. You can email your responses.
  883.  
  884. Thanks Brian
  885.  
  886. P.S. I hope I don't get alot of rtfm's, because I have been.
  887.  
  888. +++++++++++++++++++++++++++
  889.  
  890. From: fullerto@tuna.cis.ohio-state.edu (timothy dwight fullerton)
  891. Organization: The Ohio State University, Department of Computer and Information Science
  892. Date: Tue, 30 Jun 1992 01:35:18 GMT
  893.  
  894.  
  895.     Brian,
  896.  
  897.     Under system 7, you can interrupt with [cmd]-[option]-[esc].
  898.  
  899.     I am running system 6 on an LC I, and my reboot is [cmd]-[ctrl]-
  900. [power on]. There also exists a programmers switch init which I use (just
  901. in case you prefer system 6 also) that is shareware. I am not at home, and
  902. I cannot remember off the top of my head the author and version, but you
  903. should be able to get it from FTP sites or compuserve. If not, and you need
  904. it, send me mail.
  905.  
  906.     By the way, it was six months before I learned this info. It would
  907. be nice if Apple would put it in our LC manuals, wouldn't it?
  908.  
  909.         good luck,
  910.             Tim Fullerton
  911.  
  912.         fullerto@cis.ohio-state.edu
  913.  
  914.         75720.142@compuserve.com
  915.  
  916. +++++++++++++++++++++++++++
  917.  
  918. From: pegasus@leland.Stanford.EDU (Betty Lee)
  919. Organization: Stanford University -- Electrical Engineering
  920. Date: Tue, 30 Jun 1992 03:20:27 GMT
  921.  
  922. fullerto@tuna.cis.ohio-state.edu (timothy dwight fullerton) writes: 
  923.  
  924. +     Under system 7, you can interrupt with [cmd]-[option]-[esc].
  925.  
  926. Uh, that's not an interrupt.  That's a force-quit to the application.
  927. If you have MacsBug, interrupt should be <cmd>-<power> on the new Macs.
  928. (Sorry, I can't find the original article, so I'm just responding to this
  929. one.)  It worked for me in both System 6 AND System 7, so I think it's a
  930. hardware feature.
  931.  
  932. +     I am running system 6 on an LC I, and my reboot is [cmd]-[ctrl]-
  933. + [power on]. There also exists a programmers switch init which I use (just
  934. + in case you prefer system 6 also) that is shareware. I am not at home, and
  935. + I cannot remember off the top of my head the author and version, but you
  936. + should be able to get it from FTP sites or compuserve. If not, and you need
  937. + it, send me mail.
  938.  
  939. It's on sumex-aim.Stanford.EDU under /info-mac/ex/programmers-key-142.hqx.
  940. >From the doc...
  941. Programmer's Key was written by:
  942. Paul Mercer
  943. AppleLink: MERCER1
  944. Internet: pmercer@apple.com
  945. P.O. Box 160165
  946. Cupertino, CA  95014-0165
  947.  
  948. +     By the way, it was six months before I learned this info. It would
  949. + be nice if Apple would put it in our LC manuals, wouldn't it?
  950.  
  951. Aw...  But that would take all the fun out of learning all these neat
  952. tricks by yourself!  It's little things like that which separate the REAL
  953. computer enthusiasts from the theorists who can get a BS in CS and know 
  954. nothing practical whatsoever.  I know FOOD RESEARCH majors who can put any
  955. computer to better use than some CS grads.  (Then again, I might be feeling
  956. inferior because I have no interest in matrices, encryption techniques,
  957. inductive proofs, and prime number generating algorithms...  NOT!)
  958.  
  959. - -- 
  960.          Betty Lee          | The main difference between a User and a Hacker:
  961.       P. O. Box 5748        |    A User buys a faster computer to spend 
  962.     Stanford, CA 94309      |    _less_ time with it.  Happy hacking!
  963. Pegasus@Leland.Stanford.EDU |                          -- From rec.humor.funny
  964.  
  965. +++++++++++++++++++++++++++
  966.  
  967. From: zben@ni.umd.edu (Charles B. Cranston)
  968. Organization: UM Home for the Terminally Analytical
  969. Date: Tue, 30 Jun 1992 18:35:18 GMT
  970.  
  971. Nobody answered his other question, and I don't think I can get email
  972. back to an address like  bberqu@sagpd1  (:-o) so:
  973.  
  974. In article <1992Jun29.202848.11057@sagpd1>, bberqu@sagpd1 () writes:
  975.  
  976. > This one's for programmers, when creating a window can I use a Handle for
  977. > the wStorage parameter in the call to GetNewWindow, if I use a pointer 
  978. > everything works fine, but if I create it with a Handle, this causes me
  979. > problems later on in the program...
  980.  
  981. You can't put a GrafPort or anything containing a GrafPort in a handle
  982. because the data in handles can move around and the Macintosh just can't
  983. handle GrafPorts moving around.  Note that there is a GrafPort in a
  984. Window and there is a Window in a Dialog so you cannot put any of these
  985. things into a handle.
  986.  
  987. Exception: you could leave the handle locked during the whole time these
  988. things are being used, then pass a pointer (the CONTENTS of the handle)
  989. to the routines which usually take a pointer to storage.  This might be
  990. useful if you have a huge number of windows of which only some are actually
  991. being used at any one time, and any one window is only used for a short
  992. time so the locking of the handles wouldn't cause long-term fragmentation.
  993. Note that just hiding the window will not do, you would have to get it
  994. out of the window chain entirely before you could allow the handle to
  995. become unlocked.  This means you would have to destroy the window...
  996.  
  997. What I tend to do is allocate a static global array of Dialogs and have
  998. init code chain them together into a free list, then allocate and
  999. deallocate from this free list.  The only problem is that the maximum
  1000. number of Dialogs is fixed at compile time.  One could compute at init
  1001. time the maximum number of windows and allocate a nonrelocatable block
  1002. containing all the window space and allocate it the same way.  I don't
  1003. think this would be much different, however, from just letting the
  1004. system allocate and free the blocks by passing nil for wStorage.
  1005.  
  1006.  
  1007.  
  1008. +++++++++++++++++++++++++++
  1009.  
  1010. From: keith@taligent.com (Keith Rollin)
  1011. Date: 30 Jun 92 18:30:59 GMT
  1012. Organization: Taligent
  1013.  
  1014. In article <1992Jun29.202848.11057@sagpd1>, bberqu@sagpd1 writes:
  1015. > This one's for programmers, when creating a window can I use a Handle for
  1016. > the wStorage parameter in the call to GetNewWindow, if I use a pointer 
  1017. > everything works fine, but if I create it with a Handle, this causes me
  1018. > problems later on in the program for instance in another subroutine after
  1019. > the window is created I make a call to sprintf to format some data (this
  1020. > causes the mac to lockup), I'm not doing anything (that I know of) to
  1021. > the memory obtained by the handle when I make the call to sprintf,
  1022. > this works just fine by using pointers instead of handles.  Is it OK
  1023. > to use relocatable blocks for window records?
  1024. > This is how I call GetNewWindow with a handle:
  1025. >        wptr = GetNewWindow ( WINDOWID, *handle, .....
  1026.  
  1027. Technote #155 talks about this. Essentially, it says don't do it.
  1028.  
  1029. - --
  1030. Keith Rollin
  1031. Phantom Programmer
  1032. Taligent, Inc.
  1033.  
  1034.  
  1035. +++++++++++++++++++++++++++
  1036.  
  1037. From: keith@taligent.com (Keith Rollin)
  1038. Date: 1 Jul 92 17:24:01 GMT
  1039. Organization: Taligent
  1040.  
  1041. In article <1992Jun30.183518.22176@ni.umd.edu>, zben@ni.umd.edu (Charles B.
  1042. Cranston) writes:
  1043. > Nobody answered his other question, and I don't think I can get email
  1044. > back to an address like  bberqu@sagpd1  (:-o) so:
  1045. > In article <1992Jun29.202848.11057@sagpd1>, bberqu@sagpd1 () writes:
  1046. > > This one's for programmers, when creating a window can I use a Handle for
  1047. > > the wStorage parameter in the call to GetNewWindow, if I use a pointer 
  1048. > > everything works fine, but if I create it with a Handle, this causes me
  1049. > > problems later on in the program...
  1050. > You can't put a GrafPort or anything containing a GrafPort in a handle
  1051. > because the data in handles can move around and the Macintosh just can't
  1052. > handle GrafPorts moving around.  Note that there is a GrafPort in a
  1053. > Window and there is a Window in a Dialog so you cannot put any of these
  1054. > things into a handle.
  1055. > Exception: you could leave the handle locked during the whole time these
  1056. > things are being used, then pass a pointer (the CONTENTS of the handle)
  1057. > to the routines which usually take a pointer to storage.  This might be
  1058. > useful if you have a huge number of windows of which only some are actually
  1059. > being used at any one time, and any one window is only used for a short
  1060. > time so the locking of the handles wouldn't cause long-term fragmentation.
  1061. > Note that just hiding the window will not do, you would have to get it
  1062. > out of the window chain entirely before you could allow the handle to
  1063. > become unlocked.  This means you would have to destroy the window...
  1064.  
  1065. I just wanted to clarify what Ben means by leaving "the handle locked during the
  1066. whole time these things are being used." Be sure that the handle is locked
  1067. during the ENTIRE EXISTANCE of the window. That is, it is _not_ OK to do
  1068. something like:
  1069.  
  1070.     HLock((Handle) myWindowHandle);
  1071.     SetPort(*myWindowHandle);
  1072.     UpdateMyWindow(myWindowHandle);
  1073.     SetPort(mySafeDummyPort);
  1074.     HUnlock((Handle) myWindowHandle);
  1075.  
  1076. After the grafPort within the window record is created, it MUST NOT MOVE! See
  1077. Technote #155 for an explanation.
  1078.  
  1079. Since the window record must be locked during its entire existance, you might
  1080. was well create it as a non-relocatable block in the first place.
  1081.  
  1082. - --
  1083. Keith Rollin
  1084. Phantom Programmer
  1085. Taligent, Inc.
  1086.  
  1087.  
  1088. ---------------------------
  1089.  
  1090. From: aep@world.std.com (Andrew E Page)
  1091. Subject: Calling Apple Events from an Init/CDEV?
  1092. Organization: The World Public Access UNIX, Brookline, MA
  1093. Date: Tue, 30 Jun 1992 12:15:47 GMT
  1094.  
  1095.  
  1096.     Is it possible to call Apple Events from an INIT/CDEV?  I'm working
  1097. on something that might otherwise require a DRVR, but I think that
  1098. Apple Events might be friendlier to some components of the project.
  1099.  
  1100. DoD# 0581   1990 Suzuki VX800   MSF Intro Class Aug 1990
  1101. - -- 
  1102. Andrew E. Page CTO(Warrior Poet)|   Decision and Effort The Archer and Arrow
  1103. DSP Ironworks                   |     The difference between what we are
  1104. Macintosh and DSP Technology    |           and what we want to be.
  1105.  
  1106. +++++++++++++++++++++++++++
  1107.  
  1108. From: grobbins@Apple.COM (Grobbins)
  1109. Date: 30 Jun 92 18:12:57 GMT
  1110. Organization: Guillermo's Group
  1111.  
  1112. In article <BqnrEC.446@world.std.com> aep@world.std.com (Andrew E Page) writes:
  1113. >    Is it possible to call Apple Events from an INIT/CDEV?
  1114.  
  1115. It's not a good idea, but you can use the PPC Toolbox to have your
  1116. INIT communicate with a background application which serves as the
  1117. host and target for the Apple events.  For an example, see the
  1118. sample aecdev-aedaemon.hqx in the directory
  1119.  
  1120.   dts/mac/sc/snippets/toolbox.iac/apple.events
  1121.  
  1122. on ftp.apple.com
  1123.  
  1124.  
  1125. Grobbins               grobbins@apple.com
  1126.  
  1127. Usual disclaimers apply
  1128.  
  1129.  
  1130. +++++++++++++++++++++++++++
  1131.  
  1132. From: greggor@Apple.COM (Greg L. Anderson)
  1133. Date: 30 Jun 92 19:07:34 GMT
  1134. Organization: Apple Computer Inc., Cupertino, CA
  1135.  
  1136. In article <BqnrEC.446@world.std.com> aep@world.std.com (Andrew E Page) writes:
  1137. >    Is it possible to call Apple Events from an INIT/CDEV? 
  1138.  
  1139. You may AESend from a CDEV/CODE resource.  If you never call WaitNextEvent/
  1140. GetNextEvent, you won't be able to receive a reply, though.
  1141.  
  1142. - -- 
  1143. =====================   ===========================   =====================
  1144. Greg Anderson           Apple Computer, Inc.            O    Ponnuki    O
  1145. Macintosh Bodhisattva   Macintosh System Software      O O  is  ideal  O O
  1146. greggor@apple.com       Finder Team                     O     shape     O
  1147. =====================   ===========================   =====================
  1148.  
  1149. +++++++++++++++++++++++++++
  1150.  
  1151. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1152. Date: 2 Jul 92 03:31:42 GMT
  1153. Organization: University of Waikato, Hamilton, New Zealand
  1154.  
  1155. In article <69457@apple.Apple.COM>, greggor@Apple.COM (Greg L. Anderson) writes:
  1156. > In article <BqnrEC.446@world.std.com> aep@world.std.com (Andrew E Page) writes:
  1157. >>    Is it possible to call Apple Events from an INIT/CDEV?
  1158. >
  1159. > You may AESend from a CDEV/CODE resource.
  1160.  
  1161. Just to amplify on this, you may call AESend from a cdev resource, *only*
  1162. because you're running in the Finder's context, and the Finder is high-level-
  1163. event aware. AESend doesn't work from the context of an application that isn't
  1164. high-level-event aware.
  1165.  
  1166. Lawrence
  1167. been there, done that
  1168.  
  1169. +++++++++++++++++++++++++++
  1170.  
  1171. From: jeremyr@dcs.qmw.ac.uk (Jeremy Roussak)
  1172. Date: 1 Jul 92 20:43:24 GMT
  1173. Organization: Computer Science Dept, QMW, University of London
  1174.  
  1175. In <69450@apple.Apple.COM> grobbins@Apple.COM (Grobbins) writes:
  1176.  
  1177. >>    Is it possible to call Apple Events from an INIT/CDEV?
  1178.  
  1179. >It's not a good idea, but you can use the PPC Toolbox to have your
  1180. >INIT communicate with a background application which serves as the
  1181. >host and target for the Apple events.
  1182.  
  1183. Why is this not a good idea? It seems to be the only way in
  1184. which this most useful task can be accomplished.
  1185.  
  1186. Jeremy
  1187.  
  1188. +++++++++++++++++++++++++++
  1189.  
  1190. From: grobbins@Apple.COM (Grobbins)
  1191. Date: 2 Jul 92 09:29:51 GMT
  1192. Organization: Apple CTS
  1193.  
  1194. In article <1992Jul1.204324.24456@dcs.qmw.ac.uk> jeremyr@dcs.qmw.ac.uk (Jeremy Roussak) writes:
  1195. >In <69450@apple.Apple.COM> grobbins@Apple.COM (Grobbins) writes:
  1196. >>>    Is it possible to call Apple Events from an INIT/CDEV?
  1197. >>It's not a good idea, but you can use the PPC Toolbox to have your
  1198. >>INIT communicate with a background application which serves as the
  1199. >>host and target for the Apple events.
  1200. >Why is this not a good idea? It seems to be the only way in
  1201. >which this most useful task can be accomplished.
  1202.  
  1203. Sorry, I wrote that badly.  Sending an Apple event from a stand-alone
  1204. code resource is not a good idea.  Setting up a PPC link between
  1205. a code resource and an application and having the application send
  1206. the Apple event is a good idea, and is the DTS-sanctioned way to do 
  1207. this.
  1208.  
  1209. Grobbins                 grobbins@apple.com
  1210.  
  1211. Usual disclaimers apply.
  1212.  
  1213. ---------------------------
  1214.  
  1215. End of C.S.M.P. Digest
  1216. **********************
  1217.